# Darren
# 2025年02月23日22时08分09秒
import os
import sys


# 题1
def is_perfect(nums):
    nums_list = [x for x in str(nums)]
    i, j = 0, len(nums_list) - 1
    while i <= j:
        if nums_list[i] != nums_list[j]:
            print(str(nums) + "不是对称数")
            return
        i += 1
        j -= 1
    print(str(nums) + "是对称数")


try:
    while 1:
        nums = int(input("请输入一个整型数:(输入0退出)"))
        if nums == 0:
            break
        is_perfect(nums)
except ValueError as e:
    print(f"错误! {e},请输入整型数！")
# 题 2
print(sys.argv[1])
file1 = open(sys.argv[1], 'w+', encoding='utf8')
file1.write(f'这里是sys.argv[1]对应的文件{sys.argv[1]}')
file1.seek(0, os.SEEK_SET)
txt = file1.read()
print(txt)
file1.close()
